<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>📋 今日查询记录</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            background-color: #f4f4f9;
            padding: 20px;
            margin: 0;
        }
        .container {
            max-width: 800px;
            margin: 30px auto;
            background: #ffffff;
            padding: 30px;
            border-radius: 10px;
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        }
        h1 {
            color: #333;
            text-align: center;
        }
        table {
            width: 100%;
            border-collapse: collapse;
            margin-top: 20px;
        }
        th, td {
            border: 1px solid #aaa;
            padding: 10px;
            text-align: left;
        }
        th {
            background-color: #f2f2f2;
        }
        a {
            display: inline-block;
            margin-top: 20px;
            color: #007BFF;
            text-decoration: none;
            font-weight: bold;
        }
        a:hover {
            text-decoration: underline;
        }
    </style>
</head>
<body>
    <div class="container">
        <h1>📅 {{ today }} 的查询记录</h1>

        {% if records %}
            <table>
                <thead>
                    <tr>
                        <th>城市</th>
                        <th>天气</th>
                        <th>温度 (°C)</th>
                        <th>风向</th>
                        <th>风力</th>
                        <th>湿度 (%)</th>
                        <th>查询时间</th>
                    </tr>
                </thead>
                <tbody>
                    {% for record in records %}
                    <tr>
                        <td>{{ record.city }}</td>
                        <td>{{ record.weather }}</td>
                        <td>{{ record.temp }}</td>
                        <td>{{ record.wind_direction }}</td>
                        <td>{{ record.wind_power }}</td>
                        <td>{{ record.humidity }}</td>
                        <td>{{ record.data_DATE }}</td>
                    </tr>
                    {% endfor %}
                </tbody>
            </table>
        {% else %}
            <p>📭 今日暂无查询记录。</p>
        {% endif %}

        <br>
        <a href="{{ url_for('index') }}">← 返回首页</a>
    </div>
</body>
</html>